<!DOCTYPE html>
<html ng-app="demoApp">
	<head>
		<title>route_01</title>
	</head>
	<body>
		<div>
			<div ng-view=""></div>
		</div>
		<script type="text/javascript" src="angular.min.js"></script>

		<script>
			var demoApp = angular.module('demoApp', []);

			demoApp.config(function($routeProvider) {
				$routeProvider.when('/', {
					controller: 'SimpleController',
					templateUrl: 'Partials/View1.html'
				}).when('/view2', {
					controller: 'SimpleController',
					templateUrl: 'Partials/View2.html'
				}).otherwise({
					redirectTo: '/'
				});
			});

			demoApp.controller('SimpleController', function($scope) {
				$scope.customers = [{
						name: 'John Smith',
						city: 'Phoenix'
					},
					{
						name: 'John Doe',
						city: 'New York'
					},
					{
						name: 'Jane Doe',
						city: 'San Francisco'
					}
				]

				$scope.addCustomer = function() {
					$scope.customers.push({
						name: $scope.newCustomer.name,
						city: $scope.newCustomer.city
					})
				}
			});
		</script>
	</body>
	</body>
</html>
